﻿// Copyright (c) egmkang wang. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace T1
{
    using System;
    using SharpServer.SDK;
    using SharpServer.Grains;

    public class Setup : IDisposable
    {
        static OnceFlag cassandraClientFlag = new OnceFlag();
        static OnceFlag loggerFlag = new OnceFlag();

        protected Setup()
        {
            Test.IsTest += 1;

            loggerFlag.CallOnce(() =>
            {
                LoggerProvider.InitLogger("test", NLog.LogLevel.Trace);
            });
        }

        public void Dispose()
        {
            Test.IsTest -= 1;
        }
    }
}
